<%= render layout: "layouts/decidim/shared/layout_center" do %>
  <div class="flex justify-center">
    <h1 class="title-decorator my-12"><%= t("decidim.devise.omniauth_registrations.new.sign_up") %></h1>
  </div>

  <div class="text-lg text-gray-2">
    <p>
      <%= t("decidim.devise.omniauth_registrations.new.subtitle") %>
    </p>
  </div>

  <div class="login__info-required">
    <%= form_required_explanation %>
  </div>

  <%= decidim_form_for(@form, namespace: "registration", as: resource_name, url: decidim.omniauth_registrations_path(resource_name), html: { id: "omniauth-register-form" }, data: { controller: "user-registration-form" }) do |f| %>

    <div class="form__wrapper">
      <%= f.text_field :name, help_text: t("decidim.devise.omniauth_registrations.new.username_help"), autocomplete: "name", placeholder: "John Doe" %>

      <%= f.text_field :nickname, help_text: t("decidim.devise.omniauth_registrations.new.nickname_help", organization: current_organization_name), autocomplete: "nickname", placeholder: "johndoe" %>

      <%= f.email_field :email, autocomplete: "email", placeholder: t("placeholder_email", scope: "decidim.devise.shared") %>

      <%= render partial: "decidim/devise/shared/tos_fields", locals: { form: f, user: :user } %>

      <%= f.hidden_field :uid %>
      <%= f.hidden_field :provider %>
      <%= f.hidden_field :oauth_signature %>
    </div>

    <div class="form__wrapper-block">
      <button type="submit" class="button button__lg button__secondary">
        <span><%= t("decidim.devise.omniauth_registrations.new.complete_profile") %></span>
        <%= icon "arrow-right-line", class: "fill-current" %>
      </button>
    </div>
  <% end %>
<% end %>

<%= render "decidim/devise/shared/newsletter_modal" %>
